home *** CD-ROM | disk | FTP | other *** search
- code segment
-
- assume cs:code,ds:code,es:code,ss:code
-
- org 0
-
-
- befehl equ 2
- status equ 3
- anz_ger equ 13
- wechsel equ 14
- end_adr equ 14
- p_adr equ 14
- anz_bef equ 16
- anzahl equ 18
- bpb_adr equ 18
- sektor equ 26 ; !!!!!!!!!!!!!!!!!!
- ger_bez equ 22
-
-
- erst_b equ this byte
-
- dw -1,-1
- dw 0100100000000000b
- dw offset strat
- dw offset intr
- db 1
- db 7 dup (0)
-
- fkt_tab:
- dw offset init
- dw offset med_test
- dw offset get_bpb
- dw offset lesen
- dw offset lesen
- dw offset format
- dw offset dummy
- dw offset dummy
- dw offset schreibe
- dw offset schreibe
- dw offset dummy
- dw offset dummy
- dw offset schreibe
- dw offset dummy
- dw offset dummy
- dw offset no_rem
- dw offset schreibe
-
- db_ptr dw (?),(?)
- rd_seg dw (?)
-
- bpb_ptr dw offset bpb,(?)
-
- boot_sek:
- db 3 dup (0)
- db "MITI 1.0"
- bpb:
- dw 512
- db 1
- dw 1
- db 1
- dw 64
- dw 640
- db 0FDh
- dw 1
- dw 8
- dw 1
- dw 0
- db 482 dup (0)
-
- vol_name:
- db "RAMDISK "
- db 8
-
- strat proc far
- mov cs:db_ptr,bx
- mov cs:db_ptr+2,es
- ret
- start endp
-
- intr proc far
- push ax
- push bx
- push cx
- push dx
- push di
- push si
- push bp
- push ds
- push es
- pushf
-
- push cs
- pop ds
-
- les di,dword ptr db_ptr
- mov bl,es:[di+befehl]
- cmp bl,anz_bef
- jle bc_okay
-
- mov ax,8003h
- jmp short intr_end
-
- bc_okay:
- shl bl,1
- xor bh,bh
- call [fkt_tab+bx]
-
- intr_end label near
- push cs
- pop ds
-
- les di,dword ptr db_ptr
- or ax,0100h
- mov es:[di+status],ax
-
- popf
- pop es
- pop ds
- pop bp
- pop si
- pop di
- pop dx
- pop cx
- pop bx
- pop ax
- ret
- intr endp
-
-
- init proc near
- mov ah,30h
- int 21h
- cmp al,3
- jb prinm
-
- mov al,es:[di+ger_bez]
- add al,"A"
- mov im_ger,al
-
- prinm:
- mov dx,offset initm
- mov ah,9
- int 21h
-
- mov word ptr es:[di+end_adr],offset ramdisk+8000h
- mov ax,ds
- add ax,5000h
- mov es:[di+end_adr+2],ax
- mov byte ptr es:[di+anz_ger],1
- mov word ptr es:[di+bpb_adr],offset bpb_ptr
- mov es:[di+bpb_adr+2],ds
-
- mov ax,cs
- mov bpb_ptr+2,ds
- mov dx,offset ramdisk
- mov cl,4
- shr dx,cl
- add ax,dx
- mov rd_seg,ax
-
- mov es,ax
- xor di,di
- mov si,offset boot_sek
- mov cx,255
- rep movsw
-
- mov di,512
- mov al,0FDh
- stosb
- mov di,513
- mov al,0FFh
- stosb
- mov di,514
- mov cx,255
- xor ax,ax
- rep stosw
-
- mov di,1024
- mov si,offset vol_name
- mov cx,6
- rep movsw
-
- mov cx,3000
- xor ax,ax
- rep stosw
-
- xor ax,ax
- ret
- init endp
-
-
- dummy proc near
- xor ax,ax
- ret
- dummy endp
-
-
- format proc near
- push ax
- mov ah,0bh
- mov bh,0
- mov bl,9
- int 010h
- pop ax
- xor ax,ax
- ret
- format endp
-
-
- med_test proc near
- mov byte ptr es:[di+wechsel],1
- xor ax,ax
- ret
- med_test endp
-
-
- get_bpb proc near
- mov word ptr es:[di+bpb_adr],offset bpb
- mov word ptr es:[di+bpb_adr+2],ds
- xor ax,ax
- ret
- get_bpb endp
-
-
- no_rem proc near
- mov ax,20
- ret
- no_rem endp
-
-
- schreibe proc near
- xor bp,bp
- jmp short move
- schreibe endp
-
- lesen proc near
- mov bp,1
- lesen endp
-
-
- move proc near
-
- mov bx,es:[di+anzahl]
- mov dx,es:[di+sektor]
- les di,es:[di+p_adr]
-
- move_1:
- or bx,bx
- je move_e
- mov ax,dx
- mov cl,5
- shl ax,cl
-
- add ax,cs:rd_seg
- mov ds,ax
- xor si,si
- mov ax,bx
- cmp ax,128
- jbe move_2
- mov ax,128
-
- move_2:
- sub bx,ax
- add dx,ax
- mov ch,al
- xor cl,cl
- or bp,bp
- jne move_3
- mov ax,es
- push ds
- pop es
- mov ds,ax
- xchg si,di
-
- move_3:
- rep movsw
- or bp,bp
- jne move_1
- mov ax,es
- push ds
- pop es
- mov ds,ax
- xchg si,di
- jmp short move_1
-
- move_e:
- xor ax,ax
- ret
- move endp
-
- org (($-erst_b) + 16 - (($-erst_b) mod 16))
-
- ramdisk equ this byte
-
- initm db "160 KB RAM-DISK in Drive "
- im_ger db "?"
- db ": is installed. Copyright (C) 1993 by GSI$",13,10,10
-
- code ends
- end